package com.example.woh.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.woh.entity.Question;
import com.example.woh.mapper.QuestionMapper;
import com.example.woh.service.IQuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author sail
 * @since 2023-03-24
 */
@Service
@RequiredArgsConstructor
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements IQuestionService {

    private final QuestionMapper questionMapper;

    @Override
    public List<Question> queryByHomeworkId(Integer id) {
        QueryWrapper<Question> wrapper = new QueryWrapper<>();
        wrapper.eq("homework_id", id);
        return questionMapper.selectList(wrapper);
    }
}
